package userService

import (
	"github.com/fwhezfwhez/errorx"
	"helloworld/dependence/db"
	"helloworld/module/user/userModel"
)

func GetUserList(gameId int) ([]userModel.UserInfo, error) {
	var us []userModel.UserInfo
	if e := db.DB.Model(&userModel.UserInfo{}).Where("game_id=?", gameId).
		Find(&us).Error; e != nil {
		return nil, errorx.Wrap(e)
	}
	return us, nil
}
